package com.example.q_kang.hhh.login;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;

import com.example.q_kang.hhh.R;
import com.sskj.base.MVPActivity;
import com.sskj.base.bean.AgreementBean;
import com.sskj.base.view.ToolBarLayout;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author Hey
 * Create at  2019/04/17
 */
public class AgreementActivity extends MVPActivity<AgreementPresenter> {


    @BindView(R.id.toolbar)
    ToolBarLayout toolbar;
    @BindView(R.id.tv_content)
    TextView tvContent;

    @Override
    public int getLayoutId() {
        return R.layout.activity_agreement;
    }

    @Override
    public AgreementPresenter getPresenter() {
        return new AgreementPresenter();
    }

    @Override
    public void initView() {
        toolbar.setLeftButtonOnClickListener(view -> finish());
        mPresenter.getAgreement();


    }

    @Override
    public void initData() {

    }

    public static void start(Context context) {
        Intent intent = new Intent(context, AgreementActivity.class);
        context.startActivity(intent);
    }

    public void showAgreement(AgreementBean content) {
        AgreementBean.AgreeBean regInfo = content.getRegInfo();
        tvContent.setText(Html.fromHtml(regInfo.getContent()));

    }
}
